/*
 * EditSettings.java
 *
 * Created on August 8, 2007, 8:58 AM
 *
 * @author  pquiring
 *
 */

import java.io.*;
import java.awt.*;
import javax.swing.*;

import javaforce.*;
import javaforce.voip.*;

/** Dialog to allow user to edit settings. */

public class EditSettings extends javax.swing.JDialog {

  /** Creates new form EditSettings */
  private EditSettings(java.awt.Frame parent, boolean modal) {
    super(parent, modal);
    initComponents();
    tabs.remove(obsoletePanel);
    setPosition();
    byte data[] = null;
    try {
      InputStream is = getClass().getClassLoader().getResourceAsStream("readme.txt");
      int len = is.available();
      data = new byte[len];
      is.read(data);
    } catch (Exception e) {
      JFLog.log("err:load readme.txt Failed:" + e);
      System.exit(0);
    }
    about.setText(new String(data));
    about.setCaretPosition(0);
    setComponentOrientation(((parent == null) ? javax.swing.JOptionPane.getRootFrame() : parent).getComponentOrientation());
    if (parent != null) setLocationRelativeTo(parent);
    disabled_audio_codecs.setModel(disabledAudioCodecsList);
    enabled_audio_codecs.setModel(enabledAudioCodecsList);
    loadSettings();
    if (!Settings.isLinux) {
      useLinuxSound.setEnabled(false);
      useLinuxVideo.setEnabled(false);
    }
    if (!Settings.isWindows) {
      useWindowsSound.setEnabled(false);
      useWindowsVideo.setEnabled(false);
    }
    if (!Settings.isApplet) {
      useFlashSound.setEnabled(false);
      useFlashVideo.setEnabled(false);
    }
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    soundGroup = new javax.swing.ButtonGroup();
    videoGroup = new javax.swing.ButtonGroup();
    bSave = new javax.swing.JButton();
    bCancel = new javax.swing.JButton();
    tabs = new javax.swing.JTabbedPane();
    jPanel1 = new javax.swing.JPanel();
    jLabel21 = new javax.swing.JLabel();
    dndCodeOn = new javax.swing.JTextField();
    jLabel22 = new javax.swing.JLabel();
    dndCodeOff = new javax.swing.JTextField();
    jLabel34 = new javax.swing.JLabel();
    ringtone = new javax.swing.JTextField();
    selectRingtoneFilename = new javax.swing.JButton();
    jPanel10 = new javax.swing.JPanel();
    jLabel35 = new javax.swing.JLabel();
    speakerThreshold = new javax.swing.JTextField();
    jLabel36 = new javax.swing.JLabel();
    speakerDelay = new javax.swing.JTextField();
    jPanel11 = new javax.swing.JPanel();
    checkVersion = new javax.swing.JCheckBox();
    disableLogging = new javax.swing.JCheckBox();
    hideWhenMinimized = new javax.swing.JCheckBox();
    alwaysOnTop = new javax.swing.JCheckBox();
    smallerFont = new javax.swing.JCheckBox();
    usePublish = new javax.swing.JCheckBox();
    reinvite = new javax.swing.JCheckBox();
    jLabel30 = new javax.swing.JLabel();
    downloadPath = new javax.swing.JTextField();
    selectDownloadPath = new javax.swing.JButton();
    jPanel16 = new javax.swing.JPanel();
    jPanel13 = new javax.swing.JPanel();
    jLabel20 = new javax.swing.JLabel();
    audioInput = new javax.swing.JComboBox();
    audioOutput = new javax.swing.JComboBox();
    jLabel19 = new javax.swing.JLabel();
    jPanel12 = new javax.swing.JPanel();
    useLinuxSound = new javax.swing.JRadioButton();
    useJavaSound = new javax.swing.JRadioButton();
    useWindowsSound = new javax.swing.JRadioButton();
    jPanel15 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    disabled_audio_codecs = new javax.swing.JList();
    move_audio_codec_up = new javax.swing.JButton();
    move_audio_codec_down = new javax.swing.JButton();
    jScrollPane3 = new javax.swing.JScrollPane();
    enabled_audio_codecs = new javax.swing.JList();
    jLabel41 = new javax.swing.JLabel();
    jLabel42 = new javax.swing.JLabel();
    add_audio_codec = new javax.swing.JButton();
    remove_audio_codec = new javax.swing.JButton();
    jPanel17 = new javax.swing.JPanel();
    swVolForce = new javax.swing.JCheckBox();
    keepAudioOpen = new javax.swing.JCheckBox();
    jPanel9 = new javax.swing.JPanel();
    jPanel14 = new javax.swing.JPanel();
    useLinuxVideo = new javax.swing.JRadioButton();
    jLabel38 = new javax.swing.JLabel();
    linuxVideoCodec = new javax.swing.JComboBox();
    disableVideo = new javax.swing.JRadioButton();
    useWindowsVideo = new javax.swing.JRadioButton();
    jLabel40 = new javax.swing.JLabel();
    jComboBox1 = new javax.swing.JComboBox();
    jLabel31 = new javax.swing.JLabel();
    videoResolution = new javax.swing.JComboBox();
    jLabel32 = new javax.swing.JLabel();
    videoFPS = new javax.swing.JSlider();
    jPanel2 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    l1user = new javax.swing.JTextField();
    l1host = new javax.swing.JTextField();
    jLabel23 = new javax.swing.JLabel();
    l1auth = new javax.swing.JTextField();
    jLabel29 = new javax.swing.JLabel();
    l1pass = new javax.swing.JPasswordField();
    jLabel37 = new javax.swing.JLabel();
    l1disableVideo = new javax.swing.JCheckBox();
    jPanel3 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    l2user = new javax.swing.JTextField();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    l2host = new javax.swing.JTextField();
    l2same = new javax.swing.JCheckBox();
    l2sameidx = new javax.swing.JComboBox();
    jLabel24 = new javax.swing.JLabel();
    l2auth = new javax.swing.JTextField();
    l2pass = new javax.swing.JPasswordField();
    l2disableVideo = new javax.swing.JCheckBox();
    jPanel4 = new javax.swing.JPanel();
    l3same = new javax.swing.JCheckBox();
    l3sameidx = new javax.swing.JComboBox();
    l3user = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    l3host = new javax.swing.JTextField();
    jLabel9 = new javax.swing.JLabel();
    jLabel25 = new javax.swing.JLabel();
    l3auth = new javax.swing.JTextField();
    l3pass = new javax.swing.JPasswordField();
    l3disableVideo = new javax.swing.JCheckBox();
    jPanel5 = new javax.swing.JPanel();
    l4same = new javax.swing.JCheckBox();
    l4sameidx = new javax.swing.JComboBox();
    jLabel10 = new javax.swing.JLabel();
    l4user = new javax.swing.JTextField();
    jLabel11 = new javax.swing.JLabel();
    l4host = new javax.swing.JTextField();
    jLabel12 = new javax.swing.JLabel();
    jLabel26 = new javax.swing.JLabel();
    l4auth = new javax.swing.JTextField();
    l4pass = new javax.swing.JPasswordField();
    l4disableVideo = new javax.swing.JCheckBox();
    jPanel6 = new javax.swing.JPanel();
    l5same = new javax.swing.JCheckBox();
    l5sameidx = new javax.swing.JComboBox();
    jLabel13 = new javax.swing.JLabel();
    l5user = new javax.swing.JTextField();
    jLabel14 = new javax.swing.JLabel();
    l5host = new javax.swing.JTextField();
    jLabel15 = new javax.swing.JLabel();
    jLabel27 = new javax.swing.JLabel();
    l5auth = new javax.swing.JTextField();
    l5pass = new javax.swing.JPasswordField();
    l5disableVideo = new javax.swing.JCheckBox();
    jPanel7 = new javax.swing.JPanel();
    l6same = new javax.swing.JCheckBox();
    l6sameidx = new javax.swing.JComboBox();
    jLabel16 = new javax.swing.JLabel();
    l6user = new javax.swing.JTextField();
    jLabel17 = new javax.swing.JLabel();
    l6host = new javax.swing.JTextField();
    jLabel18 = new javax.swing.JLabel();
    jLabel28 = new javax.swing.JLabel();
    l6auth = new javax.swing.JTextField();
    l6pass = new javax.swing.JPasswordField();
    l6disableVideo = new javax.swing.JCheckBox();
    jPanel8 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    about = new javax.swing.JTextArea();
    obsoletePanel = new javax.swing.JPanel();
    obsolete3 = new javax.swing.JPanel();
    useFlashSound = new javax.swing.JRadioButton();
    jLabel44 = new javax.swing.JLabel();
    sampleRate = new javax.swing.JComboBox();
    jLabel45 = new javax.swing.JLabel();
    interpolation = new javax.swing.JComboBox();
    obsolete1 = new javax.swing.JPanel();
    jLabel33 = new javax.swing.JLabel();
    videoDevice = new javax.swing.JComboBox();
    useFlashVideo = new javax.swing.JRadioButton();
    jLabel39 = new javax.swing.JLabel();
    flashVideoCodec = new javax.swing.JComboBox();
    useJavaVideo = new javax.swing.JRadioButton();
    jLabel43 = new javax.swing.JLabel();
    videoWindowsAPI = new javax.swing.JComboBox();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Edit Settings");
    setModal(true);

    bSave.setText("Save");
    bSave.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        bSaveActionPerformed(evt);
      }
    });

    bCancel.setText("Cancel");
    bCancel.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        bCancelActionPerformed(evt);
      }
    });

    jLabel21.setText("DND On:");

    dndCodeOn.setText("*78");
    dndCodeOn.setToolTipText("Do not disturb on code");

    jLabel22.setText("DND Off:");

    dndCodeOff.setText("*79");
    dndCodeOff.setToolTipText("Do not disturb off code");

    jLabel34.setText("Ringtone:");
    jLabel34.setToolTipText("Must be 8000Hz, 16bit, mono, PCM");

    ringtone.setToolTipText("Must be 8000Hz, 16bit, mono, PCM");

    selectRingtoneFilename.setText("Select...");
    selectRingtoneFilename.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        selectRingtoneFilenameActionPerformed(evt);
      }
    });

    jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Speaker Phone Settings"));

    jLabel35.setText("Threshold:");
    jLabel35.setToolTipText("Range: 0-32768 (default = 1000)");

    speakerThreshold.setText("1000");
    speakerThreshold.setToolTipText("Range: 0-32768 (default = 1000)");

    jLabel36.setText("Delay (ms):");
    jLabel36.setToolTipText("default = 250");

    speakerDelay.setText("250");
    speakerDelay.setToolTipText("default = 250");

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(
      jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel10Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel36)
          .addComponent(jLabel35))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(speakerThreshold)
          .addComponent(speakerDelay))
        .addContainerGap())
    );
    jPanel10Layout.setVerticalGroup(
      jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel10Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel35)
          .addComponent(speakerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel36)
          .addComponent(speakerDelay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder("Options"));

    checkVersion.setText("Check for update on startup");

    disableLogging.setText("Disable Logging");

    hideWhenMinimized.setText("Hide when minimized");

    alwaysOnTop.setText("Always on top");

    smallerFont.setText("Use Smaller Font");

    usePublish.setText("Enable PUBLISH Presence");
    usePublish.setToolTipText("Not supported by some PBX systems.");

    reinvite.setText("Enable reinvites");
    reinvite.setToolTipText("Reinvites when callee returns multiple codecs.");

    javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
    jPanel11.setLayout(jPanel11Layout);
    jPanel11Layout.setHorizontalGroup(
      jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel11Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(hideWhenMinimized)
          .addComponent(disableLogging)
          .addComponent(checkVersion)
          .addComponent(reinvite))
        .addGap(18, 18, 18)
        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(alwaysOnTop)
          .addComponent(usePublish)
          .addComponent(smallerFont))
        .addContainerGap(30, Short.MAX_VALUE))
    );
    jPanel11Layout.setVerticalGroup(
      jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel11Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel11Layout.createSequentialGroup()
            .addComponent(checkVersion)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(disableLogging)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(hideWhenMinimized)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(reinvite))
          .addGroup(jPanel11Layout.createSequentialGroup()
            .addComponent(usePublish)
            .addGap(1, 1, 1)
            .addComponent(smallerFont)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(alwaysOnTop)))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jLabel30.setText("Recording Path:");

    selectDownloadPath.setText("Select...");
    selectDownloadPath.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        selectDownloadPathActionPerformed(evt);
      }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel1Layout.createSequentialGroup()
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel21)
              .addComponent(jLabel22)
              .addComponent(jLabel34))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
              .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(ringtone, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(selectRingtoneFilename))
              .addComponent(dndCodeOn)
              .addComponent(dndCodeOff)))
          .addGroup(jPanel1Layout.createSequentialGroup()
            .addComponent(jLabel30)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(downloadPath, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(selectDownloadPath))
          .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
            .addComponent(jPanel10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        .addContainerGap(225, Short.MAX_VALUE))
    );
    jPanel1Layout.setVerticalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel21)
          .addComponent(dndCodeOn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel22)
          .addComponent(dndCodeOff, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel34)
          .addComponent(ringtone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(selectRingtoneFilename))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel30)
          .addComponent(downloadPath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(selectDownloadPath))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addGap(382, 382, 382))
    );

    tabs.addTab("General", jPanel1);

    jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder("Java Sound Options"));

    jLabel20.setText("Audio Input:");

    audioInput.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<default>" }));

    audioOutput.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<default>" }));

    jLabel19.setText("Audio Output:");

    javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
    jPanel13.setLayout(jPanel13Layout);
    jPanel13Layout.setHorizontalGroup(
      jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel13Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel19)
          .addComponent(jLabel20))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(audioOutput, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(audioInput, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addContainerGap())
    );
    jPanel13Layout.setVerticalGroup(
      jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel13Layout.createSequentialGroup()
        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel19)
          .addComponent(audioOutput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel20)
          .addComponent(audioInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGap(0, 8, Short.MAX_VALUE))
    );

    jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder("Sound System"));

    soundGroup.add(useLinuxSound);
    useLinuxSound.setText("Use Linux (low latency) [jfLinux.org only]");
    useLinuxSound.setToolTipText("Requires the jfjni Linux package.");

    soundGroup.add(useJavaSound);
    useJavaSound.setText("Use Java (avg latency)");

    soundGroup.add(useWindowsSound);
    useWindowsSound.setText("Use Windows (low latency) [Windows only]");

    javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
    jPanel12.setLayout(jPanel12Layout);
    jPanel12Layout.setHorizontalGroup(
      jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel12Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(useLinuxSound)
          .addComponent(useJavaSound)
          .addComponent(useWindowsSound))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    jPanel12Layout.setVerticalGroup(
      jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel12Layout.createSequentialGroup()
        .addComponent(useLinuxSound)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(useJavaSound)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(useWindowsSound))
    );

    jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder("Audio Codecs"));

    disabled_audio_codecs.setModel(new javax.swing.AbstractListModel() {
      String[] strings = { "..." };
      public int getSize() { return strings.length; }
      public Object getElementAt(int i) { return strings[i]; }
    });
    disabled_audio_codecs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jScrollPane2.setViewportView(disabled_audio_codecs);

    move_audio_codec_up.setText("Up");
    move_audio_codec_up.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        move_audio_codec_upActionPerformed(evt);
      }
    });

    move_audio_codec_down.setText("Down");
    move_audio_codec_down.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        move_audio_codec_downActionPerformed(evt);
      }
    });

    enabled_audio_codecs.setModel(new javax.swing.AbstractListModel() {
      String[] strings = { "..." };
      public int getSize() { return strings.length; }
      public Object getElementAt(int i) { return strings[i]; }
    });
    enabled_audio_codecs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jScrollPane3.setViewportView(enabled_audio_codecs);

    jLabel41.setText("Disabled");

    jLabel42.setText("Enabled");

    add_audio_codec.setText("Add ->");
    add_audio_codec.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        add_audio_codecActionPerformed(evt);
      }
    });

    remove_audio_codec.setText("<- Remove");
    remove_audio_codec.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        remove_audio_codecActionPerformed(evt);
      }
    });

    javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
    jPanel15.setLayout(jPanel15Layout);
    jPanel15Layout.setHorizontalGroup(
      jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel15Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel41))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
          .addComponent(remove_audio_codec, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(add_audio_codec, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel42)
          .addGroup(jPanel15Layout.createSequentialGroup()
            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(move_audio_codec_down)
              .addComponent(move_audio_codec_up, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))))
        .addContainerGap(14, Short.MAX_VALUE))
    );
    jPanel15Layout.setVerticalGroup(
      jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel15Layout.createSequentialGroup()
        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel41)
          .addComponent(jLabel42))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel15Layout.createSequentialGroup()
            .addComponent(add_audio_codec)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(remove_audio_codec)
            .addGap(0, 0, Short.MAX_VALUE))
          .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
            .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
              .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
              .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel15Layout.createSequentialGroup()
                .addComponent(move_audio_codec_up)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(move_audio_codec_down)
                .addGap(0, 11, Short.MAX_VALUE))
              .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
            .addContainerGap())))
    );

    jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder("Options"));

    swVolForce.setText("Use Software Volume Control");
    swVolForce.setToolTipText("Do not try and use hardware control");

    keepAudioOpen.setText("Keep Audio Output Open");
    keepAudioOpen.setToolTipText("Avoid pop sound each time output is enabled.");

    javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
    jPanel17.setLayout(jPanel17Layout);
    jPanel17Layout.setHorizontalGroup(
      jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel17Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(swVolForce)
        .addGap(42, 42, 42)
        .addComponent(keepAudioOpen)
        .addContainerGap(46, Short.MAX_VALUE))
    );
    jPanel17Layout.setVerticalGroup(
      jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel17Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(swVolForce)
          .addComponent(keepAudioOpen))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
    jPanel16.setLayout(jPanel16Layout);
    jPanel16Layout.setHorizontalGroup(
      jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel16Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
          .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addContainerGap(185, Short.MAX_VALUE))
    );
    jPanel16Layout.setVerticalGroup(
      jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel16Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addGap(131, 131, 131))
    );

    tabs.addTab("Audio", jPanel16);

    jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder("Video System"));

    videoGroup.add(useLinuxVideo);
    useLinuxVideo.setText("Use Linux [jfLinux.org only]");

    jLabel38.setText("Codec:");

    linuxVideoCodec.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "JPEG" }));

    videoGroup.add(disableVideo);
    disableVideo.setSelected(true);
    disableVideo.setText("Disable Video");

    videoGroup.add(useWindowsVideo);
    useWindowsVideo.setText("Use Windows Camera [Windows only]");

    jLabel40.setText("Codec:");

    jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "JPEG" }));

    jLabel31.setText("Resolution");

    videoResolution.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "..." }));

    jLabel32.setText("FPS");

    videoFPS.setMajorTickSpacing(5);
    videoFPS.setMaximum(30);
    videoFPS.setMinimum(5);
    videoFPS.setMinorTickSpacing(1);
    videoFPS.setPaintLabels(true);
    videoFPS.setPaintTicks(true);
    videoFPS.setSnapToTicks(true);
    videoFPS.setValue(10);

    javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
    jPanel14.setLayout(jPanel14Layout);
    jPanel14Layout.setHorizontalGroup(
      jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel14Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel14Layout.createSequentialGroup()
            .addComponent(jLabel31)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(videoResolution, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          .addGroup(jPanel14Layout.createSequentialGroup()
            .addComponent(jLabel32)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(videoFPS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          .addGroup(jPanel14Layout.createSequentialGroup()
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(useLinuxVideo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel38)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(linuxVideoCodec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addComponent(disableVideo)
              .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(useWindowsVideo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel40)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGap(0, 109, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel14Layout.setVerticalGroup(
      jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel14Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(disableVideo)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(useLinuxVideo)
          .addComponent(jLabel38)
          .addComponent(linuxVideoCodec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(useWindowsVideo)
          .addComponent(jLabel40)
          .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel31)
          .addComponent(videoResolution, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel32)
          .addComponent(videoFPS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(
      jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel9Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(165, Short.MAX_VALUE))
    );
    jPanel9Layout.setVerticalGroup(
      jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel9Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(206, Short.MAX_VALUE))
    );

    tabs.addTab("Video", jPanel9);

    jLabel1.setText("Username");

    jLabel2.setText("Password");

    jLabel3.setText("Domain");

    jLabel23.setText("Auth name");

    jLabel29.setText("*Auth name is optional (default = Username)");

    jLabel37.setText("*Leave password blank to use non-REGISTERed mode");

    l1disableVideo.setText("Disable Video");

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel2Layout.createSequentialGroup()
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel23)
              .addComponent(jLabel1)
              .addComponent(jLabel2)
              .addComponent(jLabel3))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l1host, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l1user, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l1auth, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l1pass, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)))
          .addGroup(jPanel2Layout.createSequentialGroup()
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l1disableVideo)
              .addComponent(jLabel29)
              .addComponent(jLabel37))
            .addGap(0, 0, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel2Layout.setVerticalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel1)
          .addComponent(l1user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel23)
          .addComponent(l1auth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel2)
          .addComponent(l1pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel3)
          .addComponent(l1host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(l1disableVideo)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(jLabel29)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jLabel37)
        .addContainerGap(242, Short.MAX_VALUE))
    );

    tabs.addTab("Line1", jPanel2);

    jLabel4.setText("Username");

    jLabel5.setText("Password");

    jLabel6.setText("Domain");

    l2same.setText("same as ");

    l2sameidx.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Line 1", "Line 3", "Line 4", "Line 5", "Line 6" }));

    jLabel24.setText("Auth name");

    l2disableVideo.setText("Disable Video");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
      jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel3Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel3Layout.createSequentialGroup()
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel24)
              .addComponent(jLabel5)
              .addComponent(jLabel6)
              .addComponent(jLabel4))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l2user, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l2host, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l2auth, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l2pass, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)))
          .addGroup(jPanel3Layout.createSequentialGroup()
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l2disableVideo)
              .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(l2same)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(l2sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGap(0, 0, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel3Layout.setVerticalGroup(
      jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel3Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(l2same)
          .addComponent(l2sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel4)
          .addComponent(l2user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel24)
          .addComponent(l2auth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel5)
          .addComponent(l2pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel6)
          .addComponent(l2host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(l2disableVideo)
        .addContainerGap(250, Short.MAX_VALUE))
    );

    tabs.addTab("Line2", jPanel3);

    l3same.setText("same as ");

    l3sameidx.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Line 1", "Line 2", "Line 4", "Line 5", "Line 6" }));

    jLabel7.setText("Username");

    jLabel8.setText("Password");

    jLabel9.setText("Domain");

    jLabel25.setText("Auth name");

    l3disableVideo.setText("Disable Video");

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
      jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel4Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel4Layout.createSequentialGroup()
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel25)
              .addComponent(jLabel7)
              .addComponent(jLabel8)
              .addComponent(jLabel9))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l3host, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l3user, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l3auth, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l3pass, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)))
          .addGroup(jPanel4Layout.createSequentialGroup()
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l3disableVideo)
              .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(l3same)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(l3sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGap(0, 0, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel4Layout.setVerticalGroup(
      jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel4Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(l3same)
          .addComponent(l3sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel7)
          .addComponent(l3user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel25)
          .addComponent(l3auth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel8)
          .addComponent(l3pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel9)
          .addComponent(l3host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(l3disableVideo)
        .addContainerGap(250, Short.MAX_VALUE))
    );

    tabs.addTab("Line3", jPanel4);

    l4same.setText("same as ");

    l4sameidx.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Line 1", "Line 2", "Line 3", "Line 5", "Line 6" }));

    jLabel10.setText("Username");

    jLabel11.setText("Password");

    jLabel12.setText("Domain");

    jLabel26.setText("Auth name");

    l4disableVideo.setText("Disable Video");

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
      jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel5Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel5Layout.createSequentialGroup()
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel26)
              .addComponent(jLabel11)
              .addComponent(jLabel12)
              .addComponent(jLabel10))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l4user, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l4host, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l4auth, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l4pass, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)))
          .addGroup(jPanel5Layout.createSequentialGroup()
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(l4same)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(l4sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addComponent(l4disableVideo))
            .addGap(0, 0, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel5Layout.setVerticalGroup(
      jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel5Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(l4same)
          .addComponent(l4sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel10)
          .addComponent(l4user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel26)
          .addComponent(l4auth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel11)
          .addComponent(l4pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel12)
          .addComponent(l4host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(l4disableVideo)
        .addContainerGap(250, Short.MAX_VALUE))
    );

    tabs.addTab("Line4", jPanel5);

    l5same.setText("same as ");

    l5sameidx.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Line 1", "Line 2", "Line 3", "Line 4", "Line 6" }));

    jLabel13.setText("Username");

    jLabel14.setText("Password");

    jLabel15.setText("Domain");

    jLabel27.setText("Auth name");

    l5disableVideo.setText("Disable Video");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
      jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel6Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel6Layout.createSequentialGroup()
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel27)
              .addComponent(jLabel14)
              .addComponent(jLabel15)
              .addComponent(jLabel13))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l5user, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l5host, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l5auth, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l5pass, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)))
          .addGroup(jPanel6Layout.createSequentialGroup()
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l5disableVideo)
              .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(l5same)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(l5sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGap(0, 0, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel6Layout.setVerticalGroup(
      jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel6Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(l5same)
          .addComponent(l5sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel13)
          .addComponent(l5user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel27)
          .addComponent(l5auth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel14)
          .addComponent(l5pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel15)
          .addComponent(l5host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(l5disableVideo)
        .addContainerGap(250, Short.MAX_VALUE))
    );

    tabs.addTab("Line5", jPanel6);

    l6same.setText("same as ");

    l6sameidx.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Line 1", "Line 2", "Line 3", "Line 4", "Line 5", "Line 6" }));

    jLabel16.setText("Username");

    jLabel17.setText("Password");

    jLabel18.setText("Domain");

    jLabel28.setText("Auth name");

    l6disableVideo.setText("Disable Video");

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(
      jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel7Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel7Layout.createSequentialGroup()
            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel28)
              .addComponent(jLabel17)
              .addComponent(jLabel18)
              .addComponent(jLabel16))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(l6user, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l6host, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l6auth, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
              .addComponent(l6pass, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)))
          .addGroup(jPanel7Layout.createSequentialGroup()
            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(l6same)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(l6sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addComponent(l6disableVideo))
            .addGap(0, 0, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel7Layout.setVerticalGroup(
      jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel7Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(l6same)
          .addComponent(l6sameidx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel16)
          .addComponent(l6user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel28)
          .addComponent(l6auth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel17)
          .addComponent(l6pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel18)
          .addComponent(l6host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(l6disableVideo)
        .addContainerGap(250, Short.MAX_VALUE))
    );

    tabs.addTab("Line6", jPanel7);

    about.setColumns(20);
    about.setEditable(false);
    about.setRows(5);
    about.setText("...");
    jScrollPane1.setViewportView(about);

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(
      jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 611, Short.MAX_VALUE)
      .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel8Layout.createSequentialGroup()
          .addContainerGap()
          .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 591, Short.MAX_VALUE)
          .addContainerGap()))
    );
    jPanel8Layout.setVerticalGroup(
      jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 417, Short.MAX_VALUE)
      .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel8Layout.createSequentialGroup()
          .addContainerGap()
          .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
          .addContainerGap()))
    );

    tabs.addTab("About", jPanel8);

    obsolete3.setBorder(javax.swing.BorderFactory.createTitledBorder("Obsolete"));

    soundGroup.add(useFlashSound);
    useFlashSound.setText("Use Flash (high latency) [Applet only]");

    jLabel44.setText("Sample Rate:");

    sampleRate.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "8000", "32000", "44100" }));

    jLabel45.setText("Interpolation:");

    interpolation.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Linear", "Cap Filter" }));

    javax.swing.GroupLayout obsolete3Layout = new javax.swing.GroupLayout(obsolete3);
    obsolete3.setLayout(obsolete3Layout);
    obsolete3Layout.setHorizontalGroup(
      obsolete3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(obsolete3Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(obsolete3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(useFlashSound)
          .addGroup(obsolete3Layout.createSequentialGroup()
            .addComponent(jLabel44)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(sampleRate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel45)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(interpolation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        .addContainerGap(120, Short.MAX_VALUE))
    );
    obsolete3Layout.setVerticalGroup(
      obsolete3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(obsolete3Layout.createSequentialGroup()
        .addComponent(useFlashSound)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(obsolete3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel44)
          .addComponent(sampleRate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel45)
          .addComponent(interpolation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGap(0, 15, Short.MAX_VALUE))
    );

    obsolete1.setBorder(javax.swing.BorderFactory.createTitledBorder("Obsolete"));

    jLabel33.setText("Device:");

    videoDevice.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<default>" }));
    videoDevice.setEnabled(false);

    videoGroup.add(useFlashVideo);
    useFlashVideo.setText("Use Flash Camera [Applet only]");

    jLabel39.setText("Codec:");

    flashVideoCodec.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "FLV" }));

    videoGroup.add(useJavaVideo);
    useJavaVideo.setText("Use Java Camera [requires JMF - no longer supported]");
    useJavaVideo.setEnabled(false);

    jLabel43.setText("API:");

    videoWindowsAPI.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "DirectShow", "VFW" }));

    javax.swing.GroupLayout obsolete1Layout = new javax.swing.GroupLayout(obsolete1);
    obsolete1.setLayout(obsolete1Layout);
    obsolete1Layout.setHorizontalGroup(
      obsolete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(obsolete1Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(obsolete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(obsolete1Layout.createSequentialGroup()
            .addComponent(jLabel33)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(videoDevice, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE))
          .addComponent(useJavaVideo)
          .addGroup(obsolete1Layout.createSequentialGroup()
            .addComponent(useFlashVideo)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jLabel39)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(flashVideoCodec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
          .addGroup(obsolete1Layout.createSequentialGroup()
            .addComponent(jLabel43)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(videoWindowsAPI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    obsolete1Layout.setVerticalGroup(
      obsolete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(obsolete1Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(obsolete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel33)
          .addComponent(videoDevice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGap(18, 18, 18)
        .addGroup(obsolete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(useFlashVideo)
          .addComponent(jLabel39)
          .addComponent(flashVideoCodec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(useJavaVideo)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addGroup(obsolete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel43)
          .addComponent(videoWindowsAPI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap(39, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout obsoletePanelLayout = new javax.swing.GroupLayout(obsoletePanel);
    obsoletePanel.setLayout(obsoletePanelLayout);
    obsoletePanelLayout.setHorizontalGroup(
      obsoletePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(obsoletePanelLayout.createSequentialGroup()
        .addContainerGap()
        .addGroup(obsoletePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
          .addComponent(obsolete1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(obsolete3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addContainerGap(189, Short.MAX_VALUE))
    );
    obsoletePanelLayout.setVerticalGroup(
      obsoletePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(obsoletePanelLayout.createSequentialGroup()
        .addContainerGap()
        .addComponent(obsolete3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(obsolete1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(128, Short.MAX_VALUE))
    );

    tabs.addTab("obsolete", obsoletePanel);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(tabs, javax.swing.GroupLayout.PREFERRED_SIZE, 616, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addGroup(layout.createSequentialGroup()
            .addComponent(bSave)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(bCancel)))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(tabs, javax.swing.GroupLayout.PREFERRED_SIZE, 442, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addGap(18, 18, 18)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(bSave)
          .addComponent(bCancel))
        .addContainerGap())
    );

    pack();
  }// </editor-fold>//GEN-END:initComponents

  private void bSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bSaveActionPerformed
    if (!validFields()) return;
    saveSettings();
    Settings.saveSettings();
    dispose();
  }//GEN-LAST:event_bSaveActionPerformed

  private void bCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bCancelActionPerformed
    dispose();
  }//GEN-LAST:event_bCancelActionPerformed

  private void selectDownloadPathActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectDownloadPathActionPerformed
    selectDownloadPath();
  }//GEN-LAST:event_selectDownloadPathActionPerformed

  private void selectRingtoneFilenameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectRingtoneFilenameActionPerformed
    selectRingtoneFilename();
  }//GEN-LAST:event_selectRingtoneFilenameActionPerformed

  private void add_audio_codecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_add_audio_codecActionPerformed
    int idx = disabled_audio_codecs.getSelectedIndex();
    if (idx == -1) return;
    enabledAudioCodecsList.addElement((String)disabledAudioCodecsList.remove(idx));
  }//GEN-LAST:event_add_audio_codecActionPerformed

  private void remove_audio_codecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_remove_audio_codecActionPerformed
    int idx = enabled_audio_codecs.getSelectedIndex();
    if (idx == -1) return;
    disabledAudioCodecsList.addElement((String)enabledAudioCodecsList.remove(idx));
  }//GEN-LAST:event_remove_audio_codecActionPerformed

  private void move_audio_codec_upActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_move_audio_codec_upActionPerformed
    int idx = enabled_audio_codecs.getSelectedIndex();
    if ((idx == -1) || (idx == 0)) return;
    enabledAudioCodecsList.add(idx-1, (String)enabledAudioCodecsList.remove(idx));
  }//GEN-LAST:event_move_audio_codec_upActionPerformed

  private void move_audio_codec_downActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_move_audio_codec_downActionPerformed
    int cnt = enabledAudioCodecsList.getSize();
    int idx = enabled_audio_codecs.getSelectedIndex();
    if ((idx == -1) || (idx == cnt-1)) return;
    enabledAudioCodecsList.add(idx+1, (String)enabledAudioCodecsList.remove(idx));
  }//GEN-LAST:event_move_audio_codec_downActionPerformed

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JTextArea about;
  private javax.swing.JButton add_audio_codec;
  private javax.swing.JCheckBox alwaysOnTop;
  private javax.swing.JComboBox audioInput;
  private javax.swing.JComboBox audioOutput;
  private javax.swing.JButton bCancel;
  private javax.swing.JButton bSave;
  private javax.swing.JCheckBox checkVersion;
  private javax.swing.JCheckBox disableLogging;
  private javax.swing.JRadioButton disableVideo;
  private javax.swing.JList disabled_audio_codecs;
  private javax.swing.JTextField dndCodeOff;
  private javax.swing.JTextField dndCodeOn;
  private javax.swing.JTextField downloadPath;
  private javax.swing.JList enabled_audio_codecs;
  private javax.swing.JComboBox flashVideoCodec;
  private javax.swing.JCheckBox hideWhenMinimized;
  private javax.swing.JComboBox interpolation;
  private javax.swing.JComboBox jComboBox1;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JLabel jLabel10;
  private javax.swing.JLabel jLabel11;
  private javax.swing.JLabel jLabel12;
  private javax.swing.JLabel jLabel13;
  private javax.swing.JLabel jLabel14;
  private javax.swing.JLabel jLabel15;
  private javax.swing.JLabel jLabel16;
  private javax.swing.JLabel jLabel17;
  private javax.swing.JLabel jLabel18;
  private javax.swing.JLabel jLabel19;
  private javax.swing.JLabel jLabel2;
  private javax.swing.JLabel jLabel20;
  private javax.swing.JLabel jLabel21;
  private javax.swing.JLabel jLabel22;
  private javax.swing.JLabel jLabel23;
  private javax.swing.JLabel jLabel24;
  private javax.swing.JLabel jLabel25;
  private javax.swing.JLabel jLabel26;
  private javax.swing.JLabel jLabel27;
  private javax.swing.JLabel jLabel28;
  private javax.swing.JLabel jLabel29;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel30;
  private javax.swing.JLabel jLabel31;
  private javax.swing.JLabel jLabel32;
  private javax.swing.JLabel jLabel33;
  private javax.swing.JLabel jLabel34;
  private javax.swing.JLabel jLabel35;
  private javax.swing.JLabel jLabel36;
  private javax.swing.JLabel jLabel37;
  private javax.swing.JLabel jLabel38;
  private javax.swing.JLabel jLabel39;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JLabel jLabel40;
  private javax.swing.JLabel jLabel41;
  private javax.swing.JLabel jLabel42;
  private javax.swing.JLabel jLabel43;
  private javax.swing.JLabel jLabel44;
  private javax.swing.JLabel jLabel45;
  private javax.swing.JLabel jLabel5;
  private javax.swing.JLabel jLabel6;
  private javax.swing.JLabel jLabel7;
  private javax.swing.JLabel jLabel8;
  private javax.swing.JLabel jLabel9;
  private javax.swing.JPanel jPanel1;
  private javax.swing.JPanel jPanel10;
  private javax.swing.JPanel jPanel11;
  private javax.swing.JPanel jPanel12;
  private javax.swing.JPanel jPanel13;
  private javax.swing.JPanel jPanel14;
  private javax.swing.JPanel jPanel15;
  private javax.swing.JPanel jPanel16;
  private javax.swing.JPanel jPanel17;
  private javax.swing.JPanel jPanel2;
  private javax.swing.JPanel jPanel3;
  private javax.swing.JPanel jPanel4;
  private javax.swing.JPanel jPanel5;
  private javax.swing.JPanel jPanel6;
  private javax.swing.JPanel jPanel7;
  private javax.swing.JPanel jPanel8;
  private javax.swing.JPanel jPanel9;
  private javax.swing.JScrollPane jScrollPane1;
  private javax.swing.JScrollPane jScrollPane2;
  private javax.swing.JScrollPane jScrollPane3;
  private javax.swing.JCheckBox keepAudioOpen;
  private javax.swing.JTextField l1auth;
  private javax.swing.JCheckBox l1disableVideo;
  private javax.swing.JTextField l1host;
  private javax.swing.JPasswordField l1pass;
  private javax.swing.JTextField l1user;
  private javax.swing.JTextField l2auth;
  private javax.swing.JCheckBox l2disableVideo;
  private javax.swing.JTextField l2host;
  private javax.swing.JPasswordField l2pass;
  private javax.swing.JCheckBox l2same;
  private javax.swing.JComboBox l2sameidx;
  private javax.swing.JTextField l2user;
  private javax.swing.JTextField l3auth;
  private javax.swing.JCheckBox l3disableVideo;
  private javax.swing.JTextField l3host;
  private javax.swing.JPasswordField l3pass;
  private javax.swing.JCheckBox l3same;
  private javax.swing.JComboBox l3sameidx;
  private javax.swing.JTextField l3user;
  private javax.swing.JTextField l4auth;
  private javax.swing.JCheckBox l4disableVideo;
  private javax.swing.JTextField l4host;
  private javax.swing.JPasswordField l4pass;
  private javax.swing.JCheckBox l4same;
  private javax.swing.JComboBox l4sameidx;
  private javax.swing.JTextField l4user;
  private javax.swing.JTextField l5auth;
  private javax.swing.JCheckBox l5disableVideo;
  private javax.swing.JTextField l5host;
  private javax.swing.JPasswordField l5pass;
  private javax.swing.JCheckBox l5same;
  private javax.swing.JComboBox l5sameidx;
  private javax.swing.JTextField l5user;
  private javax.swing.JTextField l6auth;
  private javax.swing.JCheckBox l6disableVideo;
  private javax.swing.JTextField l6host;
  private javax.swing.JPasswordField l6pass;
  private javax.swing.JCheckBox l6same;
  private javax.swing.JComboBox l6sameidx;
  private javax.swing.JTextField l6user;
  private javax.swing.JComboBox linuxVideoCodec;
  private javax.swing.JButton move_audio_codec_down;
  private javax.swing.JButton move_audio_codec_up;
  private javax.swing.JPanel obsolete1;
  private javax.swing.JPanel obsolete3;
  private javax.swing.JPanel obsoletePanel;
  private javax.swing.JCheckBox reinvite;
  private javax.swing.JButton remove_audio_codec;
  private javax.swing.JTextField ringtone;
  private javax.swing.JComboBox sampleRate;
  private javax.swing.JButton selectDownloadPath;
  private javax.swing.JButton selectRingtoneFilename;
  private javax.swing.JCheckBox smallerFont;
  private javax.swing.ButtonGroup soundGroup;
  private javax.swing.JTextField speakerDelay;
  private javax.swing.JTextField speakerThreshold;
  private javax.swing.JCheckBox swVolForce;
  private javax.swing.JTabbedPane tabs;
  private javax.swing.JRadioButton useFlashSound;
  private javax.swing.JRadioButton useFlashVideo;
  private javax.swing.JRadioButton useJavaSound;
  private javax.swing.JRadioButton useJavaVideo;
  private javax.swing.JRadioButton useLinuxSound;
  private javax.swing.JRadioButton useLinuxVideo;
  private javax.swing.JCheckBox usePublish;
  private javax.swing.JRadioButton useWindowsSound;
  private javax.swing.JRadioButton useWindowsVideo;
  private javax.swing.JComboBox videoDevice;
  private javax.swing.JSlider videoFPS;
  private javax.swing.ButtonGroup videoGroup;
  private javax.swing.JComboBox videoResolution;
  private javax.swing.JComboBox videoWindowsAPI;
  // End of variables declaration//GEN-END:variables

  private DefaultListModel disabledAudioCodecsList = new DefaultListModel();
  private DefaultListModel enabledAudioCodecsList = new DefaultListModel();

  /** Pops up the EditSettings dialog window and returns when the dialog is closed. */

  public static void editSettings(java.awt.Frame parent) {
    EditSettings dialog = new EditSettings(parent, true);
    dialog.setVisible(true);  //doesn't return until dialog is closed
  }

  private boolean validFieldNumber(String str, int min, int max) {
    if (!validField(str)) return false;
    for(int a=0;a<str.length();a++) if ((str.charAt(a) < '0') || (str.charAt(a) > '9')) return false;
    int value = JF.atoi(str);
    if ((value < min) || (value > max)) return false;
    return true;
  }

  private boolean validFieldHexNumber(String str) {
    if (!validField(str)) return false;
    if (str.length() != 6) return false;
    for(int a=0;a<str.length();a++) {
      if (
        ((str.charAt(a) < '0') || (str.charAt(a) > '9')) &&
        ((str.charAt(a) < 'A') || (str.charAt(a) > 'F')) &&
        ((str.charAt(a) < 'a') || (str.charAt(a) > 'f')) )
        return false;
    }
    return true;
  }

  private boolean validField(String str) {
    if (str.length() == 0) return false;
    if (str.indexOf('\"') != -1) return false;
    if (str.indexOf('\'') != -1) return false;
    return true;
  }
  public final static int MIN = 16;
  public final static int MAX = 256;

  private boolean validFields() {
    if (getCodecs() == null) {
      JF.showError("Error", "Must enable at least one audio codec");
      return false;
    }
    return true;
  }

  private void loadSettings() {
    int idx;
    l1user.setText(Settings.current.lines[0].user);
    l1auth.setText(Settings.current.lines[0].auth);
    l1pass.setText(Settings.getPassword(Settings.current.lines[0].pass));
    l1host.setText(Settings.current.lines[0].host);
    l1disableVideo.setSelected(Settings.current.lines[0].disableVideo);

    l2user.setText(Settings.current.lines[1].user);
    l2auth.setText(Settings.current.lines[1].auth);
    l2pass.setText(Settings.getPassword(Settings.current.lines[1].pass));
    l2host.setText(Settings.current.lines[1].host);
    l2same.setSelected(Settings.current.lines[1].same != -1);
    l2disableVideo.setSelected(Settings.current.lines[1].disableVideo);
    idx = Settings.current.lines[1].same;
    if (idx != -1) l2sameidx.setSelectedIndex((idx > 0 ? idx-1 : idx)); else l2sameidx.setSelectedIndex(0);

    l3user.setText(Settings.current.lines[2].user);
    l3auth.setText(Settings.current.lines[2].auth);
    l3pass.setText(Settings.getPassword(Settings.current.lines[2].pass));
    l3host.setText(Settings.current.lines[2].host);
    l3same.setSelected(Settings.current.lines[2].same != -1);
    l3disableVideo.setSelected(Settings.current.lines[2].disableVideo);
    idx = Settings.current.lines[2].same;
    if (idx != -1) l3sameidx.setSelectedIndex((idx > 1 ? idx-1 : idx)); else l3sameidx.setSelectedIndex(0);

    l4user.setText(Settings.current.lines[3].user);
    l4auth.setText(Settings.current.lines[3].auth);
    l4pass.setText(Settings.getPassword(Settings.current.lines[3].pass));
    l4host.setText(Settings.current.lines[3].host);
    l4same.setSelected(Settings.current.lines[3].same != -1);
    l4disableVideo.setSelected(Settings.current.lines[3].disableVideo);
    idx = Settings.current.lines[3].same;
    if (idx != -1) l4sameidx.setSelectedIndex((idx > 2 ? idx-1 : idx)); else l4sameidx.setSelectedIndex(0);

    l5user.setText(Settings.current.lines[4].user);
    l5auth.setText(Settings.current.lines[4].auth);
    l5pass.setText(Settings.getPassword(Settings.current.lines[4].pass));
    l5host.setText(Settings.current.lines[4].host);
    l5same.setSelected(Settings.current.lines[4].same != -1);
    l5disableVideo.setSelected(Settings.current.lines[4].disableVideo);
    idx = Settings.current.lines[4].same;
    if (idx != -1) l5sameidx.setSelectedIndex((idx > 3 ? idx-1 : idx)); else l5sameidx.setSelectedIndex(0);

    l6user.setText(Settings.current.lines[5].user);
    l6auth.setText(Settings.current.lines[5].auth);
    l6pass.setText(Settings.getPassword(Settings.current.lines[5].pass));
    l6host.setText(Settings.current.lines[5].host);
    l6same.setSelected(Settings.current.lines[5].same != -1);
    l6disableVideo.setSelected(Settings.current.lines[5].disableVideo);
    idx = Settings.current.lines[5].same;
    if (idx != -1) l6sameidx.setSelectedIndex(idx); else l6sameidx.setSelectedIndex(0);

    downloadPath.setText(Settings.current.downloadPath);
    ringtone.setText(Settings.current.ringtone);
    dndCodeOn.setText(Settings.current.dndCodeOn);
    dndCodeOff.setText(Settings.current.dndCodeOff);

    speakerThreshold.setText("" + Settings.current.speakerThreshold);
    speakerDelay.setText("" + Settings.current.speakerDelay);

    swVolForce.setSelected(Settings.current.swVolForce);
//    resample441k.setSelected(Settings.current.resample441k);  //obsolete
    checkVersion.setSelected(Settings.current.checkVersion);
    disableLogging.setSelected(Settings.current.disableLogging);
    hideWhenMinimized.setSelected(Settings.current.hideWhenMinimized);
    alwaysOnTop.setSelected(Settings.current.alwaysOnTop);
    keepAudioOpen.setSelected(Settings.current.keepAudioOpen);
    smallerFont.setSelected(Settings.current.smallerFont);
    usePublish.setSelected(Settings.current.usePublish);
//    disableEnhanced.setSelected(Settings.current.disableEnhanced);
    useLinuxSound.setSelected(Settings.current.soundType == Settings.SOUND_LINUX);
    useJavaSound.setSelected(Settings.current.soundType == Settings.SOUND_JAVA);
//    useFlashSound.setSelected(Settings.current.soundType == Settings.SOUND_FLASH);
    useWindowsSound.setSelected(Settings.current.soundType == Settings.SOUND_WINDOWS);
//    disableG729a.setSelected(Settings.current.disableG729a);  //obsolete
    reinvite.setSelected(Settings.current.reinvite);
    if ((Settings.current.audioCodecs == null) || (Settings.current.audioCodecs.length() == 0)) {
      Settings.current.audioCodecs = "18,0";
    }
    disabledAudioCodecsList.clear();
    enabledAudioCodecsList.clear();
    int codecs[] = Settings.current.getCodecs();
    for(int a=0;a<codecs.length;a++) {
      switch (codecs[a]) {
        case 0: enabledAudioCodecsList.addElement("g711u"); break;
        case 8: enabledAudioCodecsList.addElement("g711a"); break;
        case 18: enabledAudioCodecsList.addElement("g729a"); break;
      }
    }
    if (!Settings.current.hasCodec(RTP.CODEC_G711u)) {
      disabledAudioCodecsList.addElement("g711u");
    }
    if (!Settings.current.hasCodec(RTP.CODEC_G711a)) {
      disabledAudioCodecsList.addElement("g711a");
    }
    if (!Settings.current.hasCodec(RTP.CODEC_G729a)) {
      disabledAudioCodecsList.addElement("g729a");
    }

    disableVideo.setSelected(Settings.current.videoType == Settings.VIDEO_NONE);
    useLinuxVideo.setSelected(Settings.current.videoType == Settings.VIDEO_LINUX);
//    useJavaVideo.setSelected(Settings.current.videoType == Settings.VIDEO_JAVA);
//    useFlashVideo.setSelected(Settings.current.videoType == Settings.VIDEO_FLASH);
    useWindowsVideo.setSelected(Settings.current.videoType == Settings.VIDEO_WINDOWS);

    videoWindowsAPI.setSelectedIndex(Settings.current.videoWindowsAPI);
    
    switch (Settings.current.sampleRate) {
      case 8000: sampleRate.setSelectedIndex(0); break;
      case 32000: sampleRate.setSelectedIndex(1); break;
      case 44100: sampleRate.setSelectedIndex(2); break;
    }
    
    interpolation.setSelectedIndex(Settings.current.interpolation);

    String mixers[] = Sound.getMixers();

    audioOutput.setModel(new javax.swing.DefaultComboBoxModel(mixers));
    for(int a=0;a<mixers.length;a++) {
      if (Settings.current.audioOutput.equalsIgnoreCase(mixers[a])) {
        audioOutput.setSelectedIndex(a);
        break;
      }
    }
    audioInput.setModel(new javax.swing.DefaultComboBoxModel(mixers));
    for(int a=0;a<mixers.length;a++) {
      if (Settings.current.audioInput.equalsIgnoreCase(mixers[a])) {
        audioInput.setSelectedIndex(a);
        break;
      }
    }

    String videoDevices[] = new String[] { "default" };  //TODO : get this from flash

    videoDevice.setModel(new javax.swing.DefaultComboBoxModel(videoDevices));
    for(int a=0;a<videoDevices.length;a++) {
      if (Settings.current.videoDevice.equalsIgnoreCase(videoDevices[a])) {
        videoDevice.setSelectedIndex(a);
        break;
      }
    }

    String resModes[] = { "<default>", "160x120", "320x240", "640x480" };

    videoResolution.setModel(new javax.swing.DefaultComboBoxModel(resModes));
    for(int a=0;a<resModes.length;a++) {
      if (Settings.current.videoResolution.equalsIgnoreCase(resModes[a])) {
        videoResolution.setSelectedIndex(a);
        break;
      }
    }

//    videoFlipHorizontal.setSelected(Settings.current.videoFlipHorizontal);
    videoFPS.setValue(Settings.current.videoFPS);

  }

  private void saveSettings() {
    Settings.current.lines[0].user = l1user.getText();
    Settings.current.lines[0].auth = l1auth.getText();
    Settings.current.lines[0].pass = "crypto(1," + Settings.encodePassword(l1pass.getPassword()) + ")";
    Settings.current.lines[0].host = l1host.getText();
    Settings.current.lines[0].same = -1;
    Settings.current.lines[0].disableVideo = l1disableVideo.isSelected();

    Settings.current.lines[1].user = l2user.getText();
    Settings.current.lines[1].auth = l2auth.getText();
    Settings.current.lines[1].pass = "crypto(1," + Settings.encodePassword(l2pass.getPassword()) + ")";
    Settings.current.lines[1].host = l2host.getText();
    Settings.current.lines[1].disableVideo = l2disableVideo.isSelected();
    if (l2same.isSelected()) Settings.current.lines[1].same = l2sameidx.getSelectedIndex(); else Settings.current.lines[1].same = -1;
    if (Settings.current.lines[1].same > 0) Settings.current.lines[1].same++;

    Settings.current.lines[2].user = l3user.getText();
    Settings.current.lines[2].auth = l3auth.getText();
    Settings.current.lines[2].pass = "crypto(1," + Settings.encodePassword(l3pass.getPassword()) + ")";
    Settings.current.lines[2].host = l3host.getText();
    Settings.current.lines[2].disableVideo = l3disableVideo.isSelected();
    if (l3same.isSelected()) Settings.current.lines[2].same = l3sameidx.getSelectedIndex(); else Settings.current.lines[2].same = -1;
    if (Settings.current.lines[2].same > 1) Settings.current.lines[2].same++;

    Settings.current.lines[3].user = l4user.getText();
    Settings.current.lines[3].auth = l4auth.getText();
    Settings.current.lines[3].pass = "crypto(1," + Settings.encodePassword(l4pass.getPassword()) + ")";
    Settings.current.lines[3].host = l4host.getText();
    Settings.current.lines[3].disableVideo = l4disableVideo.isSelected();
    if (l4same.isSelected()) Settings.current.lines[3].same = l4sameidx.getSelectedIndex(); else Settings.current.lines[3].same = -1;
    if (Settings.current.lines[3].same > 2) Settings.current.lines[3].same++;

    Settings.current.lines[4].user = l5user.getText();
    Settings.current.lines[4].auth = l5auth.getText();
    Settings.current.lines[4].pass = "crypto(1," + Settings.encodePassword(l5pass.getPassword()) + ")";
    Settings.current.lines[4].host = l5host.getText();
    Settings.current.lines[4].disableVideo = l5disableVideo.isSelected();
    if (l5same.isSelected()) Settings.current.lines[4].same = l5sameidx.getSelectedIndex(); else Settings.current.lines[4].same = -1;
    if (Settings.current.lines[4].same > 3) Settings.current.lines[4].same++;

    Settings.current.lines[5].user = l6user.getText();
    Settings.current.lines[5].auth = l6auth.getText();
    Settings.current.lines[5].pass = "crypto(1," + Settings.encodePassword(l6pass.getPassword()) + ")";
    Settings.current.lines[5].host = l6host.getText();
    Settings.current.lines[5].disableVideo = l6disableVideo.isSelected();
    if (l6same.isSelected()) Settings.current.lines[5].same = l6sameidx.getSelectedIndex(); else Settings.current.lines[5].same = -1;

    Settings.current.downloadPath = downloadPath.getText();
    Settings.current.ringtone = ringtone.getText();
    Settings.current.dndCodeOn = dndCodeOn.getText();
    Settings.current.dndCodeOff = dndCodeOff.getText();

    try {
      Settings.current.speakerThreshold = Integer.valueOf(speakerThreshold.getText());
    } catch (Exception e1) {
      Settings.current.speakerThreshold = 1000;
    }
    try {
      Settings.current.speakerDelay = Integer.valueOf(speakerDelay.getText());
    } catch (Exception e1) {
      Settings.current.speakerDelay = 1000;
    }

    Settings.current.swVolForce = swVolForce.isSelected();
//    Settings.current.resample441k = resample441k.isSelected();  //obsolete
    Settings.current.checkVersion = checkVersion.isSelected();
    Settings.current.disableLogging = disableLogging.isSelected();
    Settings.current.hideWhenMinimized = hideWhenMinimized.isSelected();
    Settings.current.alwaysOnTop = alwaysOnTop.isSelected();
    Settings.current.keepAudioOpen = keepAudioOpen.isSelected();
    Settings.current.smallerFont = smallerFont.isSelected();
    Settings.current.usePublish = usePublish.isSelected();
//    Settings.current.disableG729a = disableG729a.isSelected();  //obsolete
//    Settings.current.disableEnhanced = disableEnhanced.isSelected();
    Settings.current.reinvite = reinvite.isSelected();
    Settings.current.audioCodecs = getCodecs();
    if (useLinuxSound.isSelected()) Settings.current.soundType = Settings.SOUND_LINUX;
    if (useJavaSound.isSelected()) Settings.current.soundType = Settings.SOUND_JAVA;
//    if (useFlashSound.isSelected()) Settings.current.soundType = Settings.SOUND_FLASH;
    if (useWindowsSound.isSelected()) Settings.current.soundType = Settings.SOUND_WINDOWS;

    if (disableVideo.isSelected()) Settings.current.videoType = Settings.VIDEO_NONE;
    if (useLinuxVideo.isSelected()) Settings.current.videoType = Settings.VIDEO_LINUX;
//    if (useJavaVideo.isSelected()) Settings.current.videoType = Settings.VIDEO_JAVA;
//    if (useFlashVideo.isSelected()) Settings.current.videoType = Settings.VIDEO_FLASH;
    if (useWindowsVideo.isSelected()) Settings.current.videoType = Settings.VIDEO_WINDOWS;

    Settings.current.videoWindowsAPI = videoWindowsAPI.getSelectedIndex();
    
    switch (sampleRate.getSelectedIndex()) {
      case 0: Settings.current.sampleRate = 8000; break;
      case 1: Settings.current.sampleRate = 32000; break;
      case 2: Settings.current.sampleRate = 44100; break;
    }
    
    Settings.current.interpolation = interpolation.getSelectedIndex();
    
    Settings.current.audioInput = (String)audioInput.getSelectedItem();
    Settings.current.audioOutput = (String)audioOutput.getSelectedItem();

    Settings.current.videoDevice = (String)videoDevice.getSelectedItem();
    Settings.current.videoResolution = (String)videoResolution.getSelectedItem();

    Settings.current.videoFPS = videoFPS.getValue();
//    Settings.current.videoFlipHorizontal = videoFlipHorizontal.isSelected();
  }

  private void selectDownloadPath() {
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    chooser.setMultiSelectionEnabled(false);
    chooser.setCurrentDirectory(new File(downloadPath.getText()));
    if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) return;
    downloadPath.setText(chooser.getSelectedFile().toString().replaceAll("\\\\", "/"));
  }

  private void selectRingtoneFilename() {
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.setMultiSelectionEnabled(false);
    chooser.setCurrentDirectory(new File(JF.getUserPath()));
    if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) return;
    ringtone.setText(chooser.getSelectedFile().toString().replaceAll("\\\\", "/"));
  }
  private void setPosition() {
    Dimension d = getSize();
    Rectangle s = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
    setLocation(s.width/2 - d.width/2, s.height/2 - d.height/2);
  }
  private String getCodecs() {
    int cnt = enabledAudioCodecsList.getSize();
    if (cnt == 0) return null;
    StringBuilder sb = new StringBuilder();
    for(int a=0;a<cnt;a++) {
      if (sb.length() > 0) sb.append(",");
      String codec = (String)enabledAudioCodecsList.get(a);
      if (codec.equals("g711u")) sb.append("0");
      if (codec.equals("g711a")) sb.append("8");
      if (codec.equals("g729a")) sb.append("18");
    }
    return sb.toString();
  }
}
